package com.slliver.orderservice.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

// 加上 @RefreshScope 注解，可以对配置文件中的配置进行实时监听的功能
@RefreshScope
@RestController
public class GetConfigInfoController {

    @Value("${order.timeout}")
    private String timeout;
    @Value("${order.submitTime}")
    private String submitTime;


    @RequestMapping("/config")
    public String config() {
        return "实时获取配置文件中的配置信息 ==>> " + "\n"
                + "timeout => " + timeout + ",\n"
                + "submitTime => " + submitTime + ",\n";
    }



}
